<template>
	<view class="content">
		<view class="card-item" v-for="(item,index) in noData" :key="index" @click="gotoDeatil(item)">
			<view class="card-item-index">
				{{index+1}}
			</view>
			<view class="card-item-infos">
				<view class="card-item-info">
					<view class="info-left">单据编号：</view>
					<view class="info-right">{{item.no}}</view>
				</view>
				<view class="card-item-info">
					<text class="info-left">单据状态：</text>
					<text class="info-right">{{item.orderStatus|getStatus(OrderStatus)}}</text>
				</view>
				<view class="card-item-info">
					<text class="info-left">时间：</text>
					<text class="info-right">{{item.createdTime}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {orderStatus} from '@/service/mixins/mixins.js'
	import qs from 'qs'
	export default{
		props:{
			noData:{
				type:Array,
				default:()=>[]
			}
		},
		data(){
			return {
			}
		},
		mixins:[orderStatus],
		methods:{
			// 去详情页面
			gotoDeatil(item){
				uni.navigateTo({
					url: `/pages/sortingSearch/sortingDetail?${qs.stringify(item)}`
				})
			}
		}
	}
</script>

<style lang="scss">
	
	.content{
		margin-bottom:40rpx;
		.card-item{
			width:94%;
			height:auto;
			background-color: #fff;
			border-radius: 5rpx;
			margin: 20rpx  auto;
			padding:20rpx;
			display: flex;
			box-sizing: border-box;
			
			.card-item-index{
				width:40rpx;
				height:40rpx;
				border-radius: 20rpx;
				text-align: center;
				line-height: 40rpx;
				color:#fff;
				background-color: $color-common;
				margin-right: 10rpx;
			}
			
			.card-item-infos{
				flex: 1;
				font-size: $fontsize-common;
				
				
				.card-item-info{
					display: flex;
					margin-bottom: 8rpx;
					
					.info-left{
						width:25%;
						text-align: right;
						color:#aaa;
					}
				}
				
				.card-item-info:first-child{
					font-weight: 700;
					color:#000;
					
					.info-left{
						color:#000;
					}
				}
				
			}
		}
	}
	
</style>